<template>
  <nav class="bg-white shadow-md sticky top-0 z-50">
    <!-- 顶部导航条 -->
    <div class="container mx-auto px-2">
      <!-- 网站logo和主导航 -->
      <div class="flex items-center justify-between py-3">
        <!-- Logo -->
        <div class="flex items-center space-x-8">
          <div class="flex items-center">
            <i class="fa fa-cloud text-red-600 text-2xl"></i>
            <span class="text-xl font-bold text-red-600 ml-2">摩博云</span>
          </div>
          
          <!-- 桌面导航 -->
          <div class="hidden md:flex space-x-6">
            <a href="#" class="nav-item">首页</a>
            <a href="#" class="nav-item nav-item-active">魔学院</a>
            <a href="#" class="nav-item">解决方案</a>
            <a href="#" class="nav-item">知识商城</a>
            <a href="#" class="nav-item">客户案例</a>
            <a href="#" class="nav-item">开放合作</a>
            <a href="#" class="nav-item">服务中心</a>
            <a href="#" class="nav-item">企培社区</a>
            <a href="#" class="nav-item">关于摩博</a>
          </div>
        </div>
        
        <!-- 登录/注册按钮 -->
        <div class="hidden md:flex items-center space-x-4">
          <a href="#" class="text-gray-600 hover:text-red-600">登录</a>
          <button class="bg-red-600 hover:bg-red-700 text-white px-4 py-1.5 rounded-md transition-colors">
            免费试用
          </button>
          <button class="ml-2 text-sm text-gray-600 border border-gray-300 hover:border-red-600 hover:text-red-600 px-3 py-1 rounded-md transition-colors">
            简体中文
          </button>
        </div>
        
        <!-- 移动端菜单按钮 -->
        <button class="md:hidden p-2" @click="toggleMenu">
          <i class="fa fa-bars text-xl text-gray-600"></i>
        </button>
      </div>
      
      <!-- 移动端菜单 -->
      <div v-if="mobileMenuOpen" class="md:hidden bg-white py-2 border-t">
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">首页</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">魔学院</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">解决方案</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">知识商城</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">客户案例</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">开放合作</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">服务中心</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">企培社区</a>
        <a href="#" class="block px-4 py-2 hover:bg-gray-100">关于摩博</a>
        <div class="flex justify-between px-4 py-2">
          <a href="#" class="text-gray-600">登录</a>
          <button class="bg-red-600 text-white px-4 py-1 rounded-md">免费试用</button>
        </div>
      </div>
    </div>
  </nav>
</template>

<script>
export default {
  name: 'MoboxCloudNavbar',
  data() {
    return {
      mobileMenuOpen: false
    }
  },
  methods: {
    toggleMenu() {
      this.mobileMenuOpen = !this.mobileMenuOpen
    }
  }
}
</script>

<style scoped>
.nav-item {
  color: #666;
  text-decoration: none;
  padding: 8px 4px;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.nav-item:hover {
  color: #e53e3e;
}

.nav-item-active {
  color: #e53e3e;
  font-weight: 500;
  position: relative;
}

.nav-item-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #e53e3e;
}
</style>